﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;

namespace Love.Awesome.TMX
{
    [XmlType("object")]
    public class TMXObject
    {
        [XmlAttribute("id")]
        public int ID;

        [XmlAttribute("name")]
        public string Name;

        [XmlAttribute("class")]
        public string Class;

        [XmlAttribute("x")]
        public int X;

        [XmlAttribute("y")]
        public int Y;

        [XmlAttribute("width")]
        public int Width;

        [XmlAttribute("height")]
        public int Height;

        [XmlAttribute("rotation")]
        public float Rotation;

        [XmlAttribute("gid")]
        public int GID;

        [XmlAttribute("visible")]
        public BoolEnum Vsisble;

        [XmlAttribute("template")]
        public string Template;

        [XmlElement("properties")]
        public Properties Properties;

        [XmlElement("ellipse")]
        public Ellipse Ellipse;

        [XmlElement("point")]
        public Point Point;

        [XmlElement("polygon")]
        public Polygon Polygon;

        [XmlElement("polyline")]
        public Polyline Polyline;

        [XmlElement("text")]
        public Text Text;

        //[XmlChoiceIdentifier]
        //[XmlElement(Type = typeof(Ellipse), ElementName = "ellipse")]
        //[XmlElement(Type = typeof(Point), ElementName = "point")]
        //[XmlElement(Type = typeof(Polygon), ElementName = "polygon")]
        //[XmlElement(Type = typeof(Polyline), ElementName = "polyline")]
        //[XmlElement(Type = typeof(Text), ElementName = "text")]
        //public List<TMXObjectChild> Children;
    }
}
